package com.circulardependence;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.util.ArrayList;
import java.util.Arrays;

@SpringBootApplication
@EnableTransactionManagement
@SuppressWarnings("all")
public class CircularDependenceApplication {
//    public class CircularDependenceApplication implements CommandLineRunner {
//    @Value("${server.port}")
//    private String port;
//    @Override
//    public void run(String... args) throws Exception {
//        try {
//            Runtime.getRuntime().exec("cmd /c start http://localhost:" + port + "/person/getMyaddressById/");
//        } catch (Exception ex) {
//            ex.printStackTrace();
//        }
//    }

    public static void main(String[] args) {

        ApplicationContext applicationContext = SpringApplication.run
                (CircularDependenceApplication.class, args);

//        String[] names = applicationContext.getBeanDefinitionNames();
//        Arrays.stream(names).forEach(System.out::println);
//        Object myaddressService = applicationContext.getBean("myaddressService");

    }

}
